$(function () {
  $("header h4").text("优惠券");
  $.ajax({
    url: "http://chst.vip:1234/api/getcoupon",
    success: (res) => {
      console.log(res);
      let htm = "";
      $.each(res.result, (i, item) => {
        htm += `
        <li>
            <a href="${item.couponLink}?couponid=${item.couponId}" class="clearfix im">
                <img
                    src="${item.couponImg}"
                />
                <p>${item.couponTitle}</p>
            </a>
        </li>`;
      });
      $("main ul").html(htm);
    },
  });
});
